The present application relates to software and more specifically to systems and methods for facilitating dynamic computer code generation and use in computing environments where writing of executable memory is restricted.
Software for facilitating dynamic code generation is employed in various demanding applications including network-distributed enterprise software, general Web-based applications, and so on. Such applications often demand portable platform-independent software that can efficiently adapt to features of a host device, including host devices with significant software behavior restrictions, such as executable memory-writing restrictions.
Dynamic or automatic generation of computer code on a host device, such as a mobile device or desktop computer, may enable rapid adjustments to computer programs to meet potentially changing needs of a given implementation. Dynamic code generation can be particularly suited for interpreted programming languages and associated interpreted applications or programs, where the applications are not first completely compiled before execution. In such cases, software interpreters or Just-In-Time compilers may process computer code during application runtime.
However, software leveraging dynamic code generation often cannot be ported to computing environments and associated operating systems that do not allow writing of executable memory, i.e., computing environments where only immutable executable code is supported. A computing device with an operating system (or other features) that restricts executable-code modification represents a restricted platform exhibiting an immutable computing environment. Similarly, an operating system that restricts writing of executable memory may be called a restricted or constrained operating system.
Conventionally, to overcome such restrictions and thereby enable dynamic interpretive programs to run in immutable environments (e.g., exhibiting constrained operating systems), the programs must typically interact with a remote server. For example, the programs may be executed by a remote server in communication with a target device.
However, use of remote servers to enable dynamic or adaptive code generation can be prohibitively slow and inefficient. Furthermore, such methods may require costly support for potentially time-consuming cross-compilation to account for different target platform characteristics, such Central Processing Unit (CPU) features, operating system endiannes, and so on, which define or characterize the runtime computing environment.